//
// Created by jwhww on 25-9-24.
//

#ifndef CLIP_H
#define CLIP_H

//钳位函数大全，用于限制输入值的上下限，按需取用
int clip_int(const int x, const int low, const int up);
long clip_long(const long x, const long low, const long up);
float clip_float(const float x, const float low, const float up);
double clip_double(const double x, const double low, const double up);
uint8_t clip_uint8(const uint8_t x, const uint8_t low, const uint8_t up);
uint16_t clip_uint16(const uint16_t x, const uint16_t low, const uint16_t up);
uint32_t clip_uint32(const uint32_t x, const uint32_t low, const uint32_t up);
uint64_t clip_uint64(const uint64_t x, const uint64_t low, const uint64_t up);
int8_t clip_int8(const int8_t x, const int8_t low, const int8_t up);
int16_t clip_int16(const int16_t x, const int16_t low, const int16_t up);
int32_t clip_int32(const int32_t x, const int32_t low, const int32_t up);
int64_t clip_int64(const int64_t x, const int64_t low, const int64_t up);

#endif //CLIP_H
